{
  "properties" : { },
  "id" : "1ab87b4dbb25416c8f9b9758faaf5f2c",
  "script" : null,
  "groupId" : "9d05c436918542538232e38042f2a20a",
  "name" : "获取-匹配的菜单子节点",
  "createTime" : 1718810328067,
  "updateTime" : 1729693913461,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "管理员",
  "path" : "getNodeMenu",
  "description" : null,
  "returnType" : null,
  "mappingPath" : null,
  "parameters" : [ {
    "name" : "baseMenus",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : "java.util.Collection",
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  }, {
    "name" : "nodeMenu",
    "value" : null,
    "description" : null,
    "required" : false,
    "dataType" : "String",
    "type" : null,
    "defaultValue" : null,
    "validateType" : null,
    "error" : null,
    "expression" : null,
    "children" : null
  } ]
}
================================
import com.alibaba.fastjson.JSONObject;
import '@/system/getNodeMenu' as getNodeMenu;

for (menu in baseMenus) {
    if(nodeMenu.menuId == menu.parentId){
        var tMenu = JSONObject.toJSON(menu)
        
        if(menu.type == 0){
          tMenu["children"] = [];
          getNodeMenu(baseMenus, tMenu);
        }

        nodeMenu["children"].add(tMenu);
    }
}
